package com.yanduo.utils

import org.apache.commons.pool2.impl.GenericObjectPoolConfig
import redis.clients.jedis.{Jedis, JedisPool}

/**
  * 媒体报表实现- redis中存储字典数据
  * https://www.bilibili.com/video/BV1F4411i7jK?p=25
  * @author Gerry chan
  * 2020/5/4 15:29
  * @version 1.0
  */
object JedisPools {

  private val objectPoolFactory = new GenericObjectPoolConfig()

  objectPoolFactory.setMaxTotal(1000)

  private val jedisPool = new JedisPool(objectPoolFactory,Tools.load.getString("db.redis"))

  def getJedis:Jedis = jedisPool.getResource

}
